﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace SmokeCalcWCF
{
    [ServiceContract]
    public interface ISmokeCalc
    {
        [OperationContract]
        string Registration(string _user, string _office, string _officeaddress, string _pass);
        [OperationContract]
        string LoginCheck(string _user, string _pass);
        [OperationContract]
        string ChangePassword(string _user, string _CurrentPass, string _newPass);
        [OperationContract]
        List<Measurement> GetMeasurementList(string _param, string _value);
        [OperationContract]
        string AddMeasurement(string _chimneyId, string _userId, string _observer, string _date, string _time1,
            string _time2, string _resultringelmann, string _unitaddr, string _emissionaddr,
            string _height, string _relativeheight, string _distance, string _dir1, string _dir2, string _emissiondes1,
            string _emissiondes2, string _emissioncolor1, string _emissioncolor2, string _point1, string _point2, string _bgdes1,
            string _bgdes2, string _bgcolor1, string _bgcolor2, string _sky1, string _sky2, string _wind1, string _wind2,
            string _winddir1, string _winddir2, string _temp1, string _temp2, string _wettemp, string _rh, string _resultdetail);
        [OperationContract]
        string AddCompany(string _companyCategory, string _companyName, string _companyAddress, string _companyCity,
            string _companyProvince, string _companyPostalCode);
        [OperationContract]
        List<Company> GetCompanyList(string _param, string _value);
        [OperationContract]
        string GetCompanyId(string _companyName);
        [OperationContract]
        string AddChimney(string _companyId, string _chimneyName, string _chimneyDescription, double _chimneyLatitude,
            double _chimneyLongitude);
        [OperationContract]
        List<Chimney> GetChimneyList(string _param, string _value1, string _value2);
        [OperationContract]
        string GetChimneyId(string _chimneyLatitude, string _chimneyLongitude);
        [OperationContract]
        int[] GetOpacityStatistic();
    }

    [DataContract]
    public class UserCredential
    {
        [DataMember]
        public string UserId { get; set; }
        [DataMember]
        public string UserPassword { get; set; }
    }

    [DataContract]
    public class User
    {
        [DataMember]
        public string UserId { get; set; }
        [DataMember]
        public string UserOffice { get; set; }
        [DataMember]
        public string UserOfficeAddress { get; set; }
    }

    [DataContract]
    public class Company
    {
        [DataMember]
        public string CompanyId { get; set; }
        [DataMember]
        public string CompanyName { get; set; }
        [DataMember]
        public string CompanyCategory { get; set; }
        [DataMember]
        public string CompanyAddress { get; set; }
        [DataMember]
        public string CompanyCity { get; set; }
        [DataMember]
        public string CompanyProvince { get; set; }
        [DataMember]
        public string CompanyPostalCode { get; set; }
    }

    [DataContract]
    public class Measurement
    {
        [DataMember]
        public string MeasurementId { get; set; }
        [DataMember]
        public string ChimneyId { get; set; }
        [DataMember]
        public string UserId { get; set; }
        [DataMember]
        public string MeasurementObserver { get; set; }
        [DataMember]
        public string MeasurementDate { get; set; }
        [DataMember]
        public string MeasurementTime1 { get; set; }
        [DataMember]
        public string MeasurementTime2 { get; set; }
        [DataMember]
        public string MeasurementResultRingelmann { get; set; }
        [DataMember]
        public string MeasurementUnitAddr { get; set; }
        [DataMember]
        public string MeasurementEmissionAddr { get; set; }
        [DataMember]
        public string MeasurementHeight { get; set; }
        [DataMember]
        public string MeasurementRelativeHeight { get; set; }
        [DataMember]
        public string MeasurementDistance { get; set; }
        [DataMember]
        public string MeasurementDir1 { get; set; }
        [DataMember]
        public string MeasurementDir2 { get; set; }
        [DataMember]
        public string MeasurementEmissionDes1 { get; set; }
        [DataMember]
        public string MeasurementEmissionDes2 { get; set; }
        [DataMember]
        public string MeasurementEmissionColor1 { get; set; }
        [DataMember]
        public string MeasurementEmissionColor2 { get; set; }
        [DataMember]
        public string MeasurementPoint1 { get; set; }
        [DataMember]
        public string MeasurementPoint2 { get; set; }
        [DataMember]
        public string MeasurementBgDes1 { get; set; }
        [DataMember]
        public string MeasurementBgDes2 { get; set; }
        [DataMember]
        public string MeasurementBgColor1 { get; set; }
        [DataMember]
        public string MeasurementBgColor2 { get; set; }
        [DataMember]
        public string MeasurementSky1 { get; set; }
        [DataMember]
        public string MeasurementSky2 { get; set; }
        [DataMember]
        public string MeasurementWind1 { get; set; }
        [DataMember]
        public string MeasurementWind2 { get; set; }
        [DataMember]
        public string MeasurementWindDir1 { get; set; }
        [DataMember]
        public string MeasurementWindDir2 { get; set; }
        [DataMember]
        public string MeasurementTemp1 { get; set; }
        [DataMember]
        public string MeasurementTemp2 { get; set; }
        [DataMember]
        public string MeasurementWetTemp { get; set; }
        [DataMember]
        public string MeasurementRh { get; set; }
        [DataMember]
        public string MeasurementResultDetail { get; set; }
    }

    [DataContract]
    public class Chimney
    {
        [DataMember]
        public string ChimneyId { get; set; }
        [DataMember]
        public string CompanyId { get; set; }
        [DataMember]
        public string ChimneyName { get; set; }
        [DataMember]
        public string ChimneyDescription { get; set; }
        [DataMember]
        public double ChimneyLatitude { get; set; }
        [DataMember]
        public double ChimneyLongitude { get; set; }
    }
}
